package com.gof.example.decorate;

/**
 * Created with IntelliJ IDEA.
 * Created by zhiyuan on 2018/5/6 20:57.
 * haiming.fei@tongdun.cn
 */
public class TwoEncryption extends EncryptionDecorate {

    public TwoEncryption(Encryption e) {
        super(e);
    }

    @Override
    String enc(String str) {
        String s = super.enc(str);
        return twoEnc(s);
//        return super.enc(str);
    }

    private String twoEnc(String str) {
        System.out.println("twice encrypt");
        return str;
    }

    public void display(){
        System.out.println("show TwoEncryption");
    }
}
